package com.atldy.commerce.feign;

import com.atldy.commerce.commence.TableId;
import com.atldy.commerce.commence.goods.SimpleGoodsInfo;
import com.atldy.commerce.feign.hystrix.SecureGoodsHystrix;
import com.atldy.commerce.vo.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * <h2> 安全的商品服务 feign接口 </h2>
 * 安全是指有兜底策略
 *
 * @Author: li-dong-yang
 * @CreateTime: 2021-11-04 22:27
 */
@FeignClient(contextId = "SecureGoodsClient"
        , value = " e-commerce-service-goods"
        , fallback = SecureGoodsHystrix.class)
public interface SecureGoodsClient {

    /**
     * <p>根据tableId查询商品简单信息</p>
     *
     * @date: 2021/11/4 22:11
     * @param: [tableId]
     */
    @PostMapping("/ecommerce-service-goods/goods/deductGoodsInventory")
    CommonResponse<List<SimpleGoodsInfo>> getSimpleGoodsInfos(@RequestBody TableId tableId);


}
